package com.ygqh.baby.mapper;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ygqh.baby.ao.QueryInfo;
import com.ygqh.baby.model.YgUserCultivationDayModel;
import com.ygqh.baby.model.YgUserCultivationOrderPrice;
import com.ygqh.baby.po.YgUser;
import com.ygqh.baby.po.YgUserCultivationDay;
import com.ygqh.baby.po.YgUserCultivationDayExample;

public interface YgUserCultivationDayMapper {
	int countByExample(YgUserCultivationDayExample example);

	int deleteByExample(YgUserCultivationDayExample example);

	int deleteByPrimaryKey(Long id);

	int insert(YgUserCultivationDay record);

	int insertSelective(YgUserCultivationDay record);

	List<YgUserCultivationDay> selectByExample(YgUserCultivationDayExample example);

	YgUserCultivationDay selectByPrimaryKey(Long id);

	int updateByExampleSelective(@Param("record") YgUserCultivationDay record, @Param("example") YgUserCultivationDayExample example);

	int updateByExample(@Param("record") YgUserCultivationDay record, @Param("example") YgUserCultivationDayExample example);

	int updateByPrimaryKeySelective(YgUserCultivationDay record);

	int updateByPrimaryKey(YgUserCultivationDay record);

	int countSuper(@Param("q") String q);

	List<YgUserCultivationDay> selectSuper(@Param("queryInfo") QueryInfo queryInfo, @Param("q") String q);

	List<YgUser> selectAffiliateUser();

	List<YgUserCultivationOrderPrice> selectOrderPriceByDay(@Param("yesterday") String yesterday);

	List<YgUserCultivationOrderPrice> selectReturnPriceByDay(@Param("yesterday") String yesterday);

	List<YgUserCultivationDay> selectUserCultivationByUserId(@Param("userId") Long userId);

	List<YgUserCultivationDayModel> selectUserCultivationGroupByUserId(@Param("userId") Long userId, @Param("startDate") Date startDate);

	BigDecimal selectUserCultivationSumByUserId(@Param("userId") Long userId, @Param("startDate") Date startDate, @Param("endDate") Date endDate);

	List<YgUserCultivationDay> affiliateUserReportV2(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("userId") Long userId);

	int addBatch(@Param("list") List<YgUserCultivationDay> list);

	int additional(@Param("list") List<YgUserCultivationDay> list);

	List<YgUserCultivationDay> getSumGroupByUserId(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

	List<YgUserCultivationDay> getSumGroupByMonth(@Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("userId") Long userId);

}
